// dom2事件
 var EventUtil = {    
    addHandler: 
      function(element, type, handler)
      {        
        if (element.addEventListener){ 
            element.addEventListener(type, handler, false);    
        } 
        else if(element.attachEvent){
            element.attachEvent("on" + type, handler); 
        } 
        else 
        {            
          element["on" + type] = handler;
           }
       },
    removeHandler: 
       function(element, type, handler)
       {        
        if (element.removeEventListener){ 
             element.removeEventListener(type, handler, false);  
        } 
        else if (element.detachEvent){ 
            element.detachEvent("on" + type, handler); 
        } 
        else
        {   
          element["on" + type] = null;        
        }    
       }
  };
// //获取id函数
function getId(id)
{
  var el=document.getElementById(id);
  return el;
}



 //继承
 function object(o)
   {
      function F(){}
      F.prototype=o;
      return new F();
   }
   function inheritPrototype(subType, superType)
   {  
      //创建对象    
      var prototype = object(superType.prototype);   
      //增强对象   
      prototype.constructor = subType;   
      //指定对象   
      subType.prototype = prototype;
   }

   function check(sname)
{
  return function(){
    if(sname.className=="inputstyle1")
    {
      sname.className="inputstyle0";
    }
      //dota.className="dota";
      else
      {
        sname.className="inputstyle1";
      }
    
  }
}


 function checkall()
 {
  if(dota.className=="check00")
  {

    dota.className="check1";
    input1.className="inputstyle1";
    //input2.className="inputstyle1";
    //input3.className="inputstyle1";
  }
  else
  {
    dota.className="check00";
    input1.className="inputstyle0";
    //input2.className="inputstyle0";
    //input3.className="inputstyle0";
  }
 }

   window.onload=function()
   {
    var edit=getId("edit");
    var ok=getId("ok");
    var input1=getId("input1");
    var input2=getId("input2");
    var input3=getId("input3");
    var check0=getId("check0");

    var edit1=function(){
           edit.style.display="none";
           ok.style.display="inline";
           input1.style.display="inline";
           // input2.style.display="inline";
           // input3.style.display="inline";
           check0.style.display="block";
       };
    var edit2=function(){
       edit.style.display="inline";
       ok.style.display="none";
       input1.style.display="none";
       // input2.style.display="none";
       // input3.style.display="none";
       check0.style.display="none";
   };
     EventUtil.addHandler(edit,"click",edit1);
     EventUtil.addHandler(ok,"click",edit2);
    EventUtil.addHandler(input1,"click",check(input1));
     EventUtil.addHandler(dota,"click",checkall);
   }